package com.yanyeori.framework.jira.jiraclient.greenhopper;

import com.yanyeori.framework.jira.jiraclient.Field;
import net.sf.json.JSONObject;

/**
 * GreenHopper epic statistics.
 */
public class EpicStats {

    private Double notDoneEstimate;
    private Double doneEstimate;
    private int estimated;
    private int notEstimated;
    private int notDone;
    private int done;

    /**
     * Creates an estimate sum from a JSON payload.
     *
     * @param json JSON payload
     */
    protected EpicStats(JSONObject json) {
        notDoneEstimate = Field.getDouble(json.get("notDoneEstimate"));
        doneEstimate = Field.getDouble(json.get("doneEstimate"));
        estimated = Field.getInteger(json.get("estimated"));
        notEstimated = Field.getInteger(json.get("notEstimated"));
        notDone = Field.getInteger(json.get("notDone"));
        done = Field.getInteger(json.get("done"));
    }

    public Double getNotDoneEstimate() {
        return notDoneEstimate;
    }

    public Double getDoneEstimate() {
        return doneEstimate;
    }

    public int getEstimated() {
        return estimated;
    }

    public int getNotEstimated() {
        return notEstimated;
    }

    public int getNotDone() {
        return notDone;
    }

    public int getDone() {
        return done;
    }
}
